<?php use_helper('Javascript') ?>
<h2>Reporte de Causas: <?php echo $acreedor ?></h2>
<?php if(count($causasList) > 0): ?>
<table>
	<thead>
		<tr>
			<td colspan="3">
			<?php echo button_to_remote('Generar PDF Causas',array(
						'update' 	=> 'modulo',			
						'url' 		=> 'informes/indexinforme',
						'loading'	=> visual_effect('appear','loading', array('duration' => 0)),
						'complete'	=> visual_effect('fade','loading', array('duration' => 0)),
			)) ?></td>
		</tr>
		<tr>
			<th>Rol</th>
			<th>Nombre</th>
			<th>Estado Actual</th>
			<th></th>
		</tr>
	</thead>
	<tbody>
  <?php foreach($causasList as $causa): ?>
	<tr>
		<td><?php echo $causa->getRol()?></td>
		<td><?php echo $causa->getNombre()?></td>
		<td><?php echo $causa->getEstadoCausaActivo()->getEstado()->getNombre()?></td>
		<td><?php 
		
		echo button_to_function('+',
		visual_effect('blindDown','causa_'.$causa->getId()).
		visual_effect('fade','mas_'.$causa->getId(), array('duration' => 0)).
		visual_effect('appear','menos_'.$causa->getId(), array('duration' => 0)),
		array('id' => 'mas_'.$causa->getId())
		);
		
		echo button_to_function('-',
		visual_effect('blindUp','causa_'.$causa->getId()).
		visual_effect('appear','mas_'.$causa->getId(), array('duration' => 0)).
		visual_effect('fade','menos_'.$causa->getId(), array('duration' => 0)),
		array('id' => 'menos_'.$causa->getId(),'style' => 'display:none')
		)?></td>
		<td><?php echo button_to_remote('Generar PDF Detalle',array(
						'update' 	=> 'acciones_informe',			
						'url' 		=> 'informes/generareportecausa?id_causa='.$causa->getId(),
						'loading'	=> visual_effect('appear','loading', array('duration' => 0)),
						'complete'	=> visual_effect('fade','loading', array('duration' => 0)),
			))?></td>
	</tr>
	<tr id="<?php echo 'causa_'.$causa->getId()?>" style="display:none">
		<td colspan="4">
			<?php echo 'AQUI VA EL DETALLE!' ?>
		</td>
	</tr>
  <?php endforeach; ?>
	</tbody>
</table>
<?php else: ?>
<strong>NO POSEE CAUSAS ACTIVAS EN EL ESTADO ELEGIDO</strong>
<br />
<?php echo button_to_remote('Buscar otra vez', array(
			'update' => 'acciones_informe',
    		'url'    => 'administracion/searchacreedor?accion=reportecausas',
			'loading'	=> visual_effect('appear','loading', array('duration' => 0)),
			'complete'	=> visual_effect('fade','loading', array('duration' => 0)),
			)) ?>
<?php endif; ?>